﻿@using mscook.mvc;
@model mscook.core.domain.AboutUs
@{
    ViewBag.Title = "美食";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section JavaScript
{
    <script type="text/javascript">

        $(function () {
            var host = "@Url.Action("SelectImageSetting", "home")";
            var $w = $(window);
            var $scr_wid = $(window).width();
            var $w_height = $w.height();
            var acc_min_width;//accordion
            var feature_width, feature_height, feature_pad_side;//3DfeatureCarousel

            var url = location.host

            //左侧菜单随屏幕滚动
            if ($scr_wid >= 1024) {
                setTimeout(function () {
                    var height = $(window).height();
                    var top = $('.recipes_menu').offset().top;
                    var scrolltop = $(document).scrollTop();
                    var this_height = $('.recipes_menu').height();
                    var bottom = $('.footer').height() + 150;

                    $('.recipes_menu').affix({
                        offset: {
                            top: function () { return $w.width() <= 980 ? 290 : top + this_height }
                        , bottom: 0
                        }
                    })
                }, 100)
            }
            function menu_cheak(selector, classname) {
                var $select = selector;
                $select.click(function () {
                    $(this).addClass(classname).siblings().removeClass(classname);

                })

            }
            menu_cheak($('.nav li'), 'active');
            menu_cheak($('.recipes .recipes_menu .menu_main dl dd a'), 'chosed');
            function accordion_menu(selector, operated, classname) {
                var $select = selector;
                $select.click(function () {

                    $(this).parent().toggleClass(operated);
                    $(this).next(classname).slideToggle(300);
                })

            }
            accordion_menu($('.recipes .recipes_menu .menu_main dl dt'), 'on', 'dd');



            (function () {
                $('body').animate({ scrollTop: $('.navbar').offset().top }, 1000);
            })();//友好的页面显示，全局作用



            $.getJSON(host, function (config) {
                var folder;
                var $scr_wid = $(window).width();
                var banner_wid;
                var banner_hei;
                var screen_num;
                function hasFolder(set, folder) {
                    var image_setting = null;
                    $.each(set, function (i, elem) {
                        if (elem.folder == folder) {
                            image_setting = elem;
                            return false;
                        }
                    });
                    return image_setting;
                }
                $.each(config, function (i, item) {
                    //alert(config[i].name);
                    var images = config[i].ImageSettings;
                    //alert(images.folder);
                    //var img_fol = images.folder;
                    if (images != null && images.length != 0) {
                        var image_setting;
                        if ($scr_wid >= 1200 && (image_setting = hasFolder(images, "wide")) !== null) {
                            folder = "wide";
                            acc_min_width = "115px";
                            banner_wid = image_setting.width;
                            banner_hei = image_setting.height;
                            screen_num = 7;
                            //feature_width = 450;
                            //feature_height = 230;

                        } else if ($scr_wid >= 768 && $scr_wid <= 979 && (image_setting = hasFolder(images, "pad")) !== null) {
                            folder = "pad";
                            acc_min_width = "30px";
                            banner_wid = image_setting.width;
                            banner_hei = image_setting.height;
                            screen_num = 5;
                            //feature_width = 340;
                            //feature_height = 174;


                        } else if ($scr_wid < 768 && (image_setting = hasFolder(images, "mobile")) !== null) {
                            folder = "mobile";
                            acc_min_width = "20px";
                            banner_wid = image_setting.width;
                            banner_hei = image_setting.height;
                            screen_num = 7;


                        } else {
                            image_setting = hasFolder(images, "default");
                            folder = "default";
                            acc_min_width = "70px";
                            banner_wid = image_setting.width;
                            banner_hei = image_setting.height;
                            screen_num = 7;
                            //feature_width = 450;
                            //feature_height = 230;
                        }
                        $('div[data-image-setting=' + config[i].alias + '] img').each(function (i, img) {
                            var $img = $(img);

                            var $slide_li = $img.parent();
                            var source = $img.data("source");
                            if (source) {
                                var data = "@Url.Content("~/Upload/")" + folder + "/" + source;
                                if (data) {
                                    $img.attr("data-src", data);
                                    $slide_li.attr("data-bottom-thumb", data);
                                }
                            }
                            $img.unveil();


                        });




                    }

                })

            });

        });

    </script>
}
<hr class="recipes-divider">
<div class="container">
    <div class="detail_info clearfix">
        <div class="row">

           @* <div class="span4">
                <div class="detail_img" data-image-setting="Bulletin">
                    <img src="~/lazyload/grey.gif" data-source="@Model.Bulletin.ImagePath" />
                </div>
            </div>*@
            <div class="span8">
                <div class="info1 clearfix">
                    <h1 class="title pull-left">
                        <a href="#">@Html.Encode(Model.Name)</a>
                    </h1>


                </div>
                <div class="info2">
                    <p class="basicinformation clearfix">
                        <label>@Html.Encode(Model.CreateTime.ToShortDateString())</label>
                   @*     <label><span class="wherecomewarp">来源：《美食之窗》杂志</span></label>*@
                       
                    </p>
                </div>               
               @* <div class="info2">
                    <p class="info_detail">
                        <strong>“</strong>@Html.Raw(Model.Content)<strong>”</strong>
                    </p>
                </div>*@

            </div>

        </div>
    </div>
    <div class="detail_info clearfix">
        <div class="row">

            <div class="span8">
                <div class="info_act">
                    @Html.Raw(Model.Content)
                </div>
            </div>
          @*   @Html.Partial("_PushMagazine")*@
        </div>
    </div>
</div>
